<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <%
        pageContext.setAttribute("APP_PATH", request.getContextPath());
    %>
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>教师</title>
</head>
<jsp:include page="teacher_header.jsp"/>

<div class="container">
    <form class="form-horizontal" id="add" method="post">
        <table class="table table-bordered">
            <div class="form-group">
                <tr>
                    <th>
                        <div class="col-sm-6">专利名称：</div>
                    </th>
                    <th>
                        <input type="hidden" class="form-control" name="teacherid" value="${id_infor}">
                        <input class="form-control" name="patentname">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">专利编号：</div>
                    </th>
                    <th>
                        <input class="form-control" name="patentid">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">专利所有人：</div>
                    </th>
                    <th>
                        <input class="form-control" name="itemown">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">第一发明人：</div>
                    </th>
                    <th>
                        <input class="form-control" name="firstname">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">发明人：</div>
                    </th>
                    <th>
                        <input class="form-control" name="allname">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">专利类型：</div>
                    </th>
                    <th>
                        <input class="form-control" placeholder="发明专利/实用新型专利/外观设计专利" name="patenttype">
                    </th>
                </tr>
                <tr>
                    <th>
                        <div class="col-sm-6">授权日期：</div>
                    </th>
                    <th>
                        <input class="form-control" name="endtime" value="xxxx-xx-xx">
                    </th>
                </tr>
            </div>
        </table>
        <div class="col-md-4 col-md-offset-4">
            <button class="btn btn-primary btn-lg" type="reset">重置</button>
            <button class="btn btn-success btn-lg" id="btn_add_patent">提交</button>
        </div>
    </form>

    <script>
        $("#btn_add_patent").click(function () {
            $.ajax({
                url: "${APP_PATH}/add_patent",
                type: "POST",
                data: $("#add").serialize(),
                success: function (result) {
                    alert(result.message);
                },
                error: function () {
                    alert("对不起，请求失败！");
                }
            });
        });
    </script>
</div>
</body>
</html>
